<!DOCTYPE html>
<?php 
 session_start(); 
if (!isset($_SESSION['tema'])) {
                $_SESSION['tema'] = "Calor";
            }
            if (isset($_POST)) {
                if (isset($_POST['tema'])) {
                    $sendTema = $_POST['tema'];
                    $_SESSION['tema'] = $sendTema;
                }
            }?>
<html>
    <head>
        <meta charset="utf-8">
        <title>. : Carinho : . </title>
        <link href="css/<?php echo $_SESSION['tema'] == "Calor" ? "style-hot.css" : ($_SESSION['tema'] == "Frio" ? "style-cool.css" : "style-gay.css") ?>" rel="stylesheet" type="text/css"/>
    </head>
    <body onload="teste()">
        <div id="container-acess">
            <?php
            
            if (isset($_SESSION["autenticacao"])) {
                if ($_SESSION['autenticacao'] == "ok") {
                    ?>
                    <div class="text">
                        <a  href="carinho.php"><img src="img/carinho.png"/></a>
                        <?php echo $_SESSION['usuario_nome'] ?>
                        <a class="link" href="login.php?session=stop">Sair</a> 
                        
                    </div>
                <?php }
            } else {
                ?>
                <form method="post" action="login.php">
                    <input type="text" placeholder="login" name="ip_login">
                    <input type="password" placeholder="senha" name="ip_senha">
                    <input class="link" type="submit" value="LogIn">
                </form>
            <?php }?>
            <div class="chose-style">
                    <div class="chose-style">
                        <form method="post" id="formulario">
                            <select name="tema" onchange="send()" >
                                <option value="Calor" <?php echo $_SESSION['tema'] == 'Calor' ? "selected" : ""; ?>>Calor</option>
                                <option value="Frio" <?php echo $_SESSION['tema'] == 'Frio' ? "selected" : ""; ?>>Frio</option>
                                <option value="Gay" <?php echo $_SESSION['tema'] == 'Gay' ? "selected" : ""; ?>>Gay</option>
                            </select>
                        </form></div>
                    <div class="chose-style text">Escolha um tema</div>
                </div>
        </div>
        <div id="conteudo">
            <div id="cabesario">
                <h1>Rede Shuthz de moambas</h1>
                <div id="menu-navegator">
                    <ul>
                        <li><a href="index.php">Produtos</a></li>
                        <li><a href="carinho.php">Carinho</a></li>
                    </ul>
                </div>
            </div>
            <script>
            function send() {
                document.getElementById("formulario").submit();
                
            }
        </script>